package com.zy.edu.controller;


import com.zy.edu.bean.CourseChapterDoc;
import com.zy.edu.bean.InputParam;
import com.zy.edu.service.CourseChapterDocService;
import com.zy.edu.service.CourseChapterDocService;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.Valid;
import java.util.Map;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author HuangHaiShui
 * @since 2021-07-24
 */
@RestController
@RequestMapping("/doc")
public class CourseChapterDocController {
    @Resource
    CourseChapterDocService courseChapterDocService;

    /**
     * @Author: HuangHaiShui
     * @Description: 数据的新增与修改
     * @Date: 9:17 2021/7/14
     * @param courseChapterDoc:
     * @return: Map
     **/
    @RequestMapping("/edit")
    public Map edit(@Valid CourseChapterDoc courseChapterDoc, InputParam inputParam){
        return courseChapterDocService.saveOrUpdate(courseChapterDoc,inputParam);
    }
    @RequestMapping("/list")
    public Map list(CourseChapterDoc courseChapterDoc, InputParam inputParam){

        return courseChapterDocService.list(courseChapterDoc, inputParam);
    }


    /**
     * @Author: HuangHaiShui
     * @Description: 删除数据
     * @Date: 9:18 2021/7/14
     * @param courseChapterDoc:  传入id 字段
     * @return: Map
     **/
    @RequestMapping("/dele")
    public Map dele( CourseChapterDoc courseChapterDoc){
        return courseChapterDocService.dele(courseChapterDoc);
    }
    @RequestMapping("/getById")
    public Map getById(CourseChapterDoc courseChapterDoc, InputParam inputParam){

        return courseChapterDocService.getById(courseChapterDoc, inputParam);
    }
}

